Release 10.1A: OpenEdge Data Management:
SQL Reference
DECODE
Compares the value of the first argument
expressionwith eachsearch_expressionand, if a match is found, returns the correspondingmatch_expression. If no match is found, then the function returns thedefault_expression. If adefault_expressionis not specified and no match is found, the function returns aNULLvalue.Syntax
Example
This example illustrates one way to use the
DECODEfunction:
Notes
- Use a simple case expression when SQL-compatible syntax is a requirement.
- The first argument
expressioncan be of any type. The types of allsearch_expressionsmust be compatible with the type of the first argument.- The
match_expressionscan be of any type. The types of allmatch_expressionsmust be compatible with the type of the firstmatch_expression.- The type of the
default_expressionmust be compatible with the type of the firstmatch_expression.- The type of the result is the same as that of the first
match_expression.- If the first argument
expressionisNULL, then the value of thedefault_expressionis returned, if it is specified. OtherwiseNULLis returned.Compatibility
Progress extension
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |